/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ca.trader.utils;

import org.jasypt.util.password.StrongPasswordEncryptor;

/**
 *
 * @author Ahsan
 */
public class PasswordUtils
{

	 public static String cryptPasswordString(String password)
	 {
		  StrongPasswordEncryptor passwordEncryptor = new StrongPasswordEncryptor();
		  String encryptedPassword = passwordEncryptor.encryptPassword(password);

		  return encryptedPassword;
	 }

	 public static boolean TestCryptedPassword(String userUncryptedPassword, String cryptedPassword)
	 {
		  StrongPasswordEncryptor passwordEncryptor = new StrongPasswordEncryptor();
		  return passwordEncryptor.checkPassword(userUncryptedPassword, cryptedPassword);
	 }

}
